﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RayTracing
{
    public class Ray
    {
        public P3 origin, direction;

        public Ray (P3 orgin, P3 direction)           //Create a new ray with an origin P3 and a direction P3
        {
            this.origin = orgin;
            this.direction = P3.normalize(direction); //Normalizes direction
        }

        public P3 travel(float distance)                  //Get the distance a ray travels the direction of the origin and scaling it
        {
            return this.origin.add((this.direction).scale(distance));
        }

    }
}
